import request from '../utils/request'

const baseUrl = 'user'

export function login(username, password, code) {
    return request({
        url: baseUrl + '/login',
        method: 'post',
        data: {
            username: username,
            password: password,
            code: code
        }
    })
}

export function register(username, password, code) {
    return request({
        url: baseUrl + '/register',
        method: 'post',
        data: {
            username: username,
            password: password,
            code: code
        }
    })
}

export function logout() {
    return request({
        url: baseUrl + '/logout',
        method: 'get',
        params: {}
    })
}